/*
********************************************************************************
* Copyright (C) 2021, xiang.D <dx_65535@163.com>.
* All right reserved.
*
* File Name   : main.cc
* Author      :
* Version     : V1.0
* Description :
* Journal     : 2021-11-27 init v1.0
* Brief       : Blog: https://blog.csdn.net/qq_38750572?spm=1001.2014.3001.5343
* Others      :
********************************************************************************
*/
#include <stdio.h>
#include "invoker.h"

#define MAIN_LOGI(fmt, args...) printf("Main: I: %d " fmt, __LINE__, ##args)
#define MAIN_LOGD(fmt, args...) printf("Main: D: %d " fmt, __LINE__, ##args)
#define MAIN_LOGW(fmt, args...) printf("Main: W: %d " fmt, __LINE__, ##args)
#define MAIN_LOGE(fmt, args...) printf("Main: E: %d " fmt, __LINE__, ##args)

int main(int argc, char *argv[])
{
    int ret = -1;
    CInvoker *theInvoker = CInvoker::GetInstance();

    ret = theInvoker->Invoke(CMD_LED_HORSE);
    MAIN_LOGI("Invoke 0x%x %s \n", CMD_LED_HORSE, (ret == 0) ? "success" : "failure");

    ret = theInvoker->Invoke(CMD_MOTOR_BACKWARD);
    MAIN_LOGI("Invoke 0x%x %s \n", CMD_MOTOR_BACKWARD, (ret == 0) ? "success" : "failure");

    return 0;
}